package datastructure.sort.sortmethod;

/**
 * 选择排序
 * Created by tanlee on 2016/3/17.
 */
public class SelectionSort extends BaseSort {

    @Override
    public void sort(Comparable[] a) {
        for (int i=0;i<a.length;i++){
            for (int j=i+1;j<a.length;j++){
                if(!less(a[i],a[j])){
                    exchange(a,i,j);
                }
            }
        }
    }
}
